<div class="main">
    <div class="main-nav fl">
        <ul class="nave nav-tabs container">
            <li class="active"><a href="javascript:void(0)">任务大厅</a></li>
            <li class=""><a href="smission.html">我的任务</a></li>
            <?php if($user->user_identity==1){ ?>
            <li class=""><a href="#">绑定买号</a></li>
            <?php }elseif($user->user_identity==2){ ?>
            <li class=""><a href="/task/bindtb">绑定店铺</a></li>
            <li class="resa rela"><a href="/task/tasktemplate">发布任务</a></li>
            <?php } ?>
        </ul>
    </div>
    <div class="container task-wrap hid">
        <div class="filter-wrap fl">
            <form id="filterForm" action="/filter" method="post">
                <dl class="task-filter cf">
                    <dt class="fl">任务类型</dt>
                    <dd>
                        <ul class="selection cf">
                            <li class="fl">
                                <?php if(count($taskEntrance)<=0){ ?><input name="entrance[]" value="2" type="checkbox" />
                                <?php }elseif(count($taskEntrance)==1){ ?>
                                    <?php if($taskEntrance[0]==2){ ?><input name="entrance[]" value="2" type="checkbox" checked />
                                    <?php }else{ ?><input name="entrance[]" value="2" type="checkbox" /><?php } ?>
                                <?php }elseif(count($taskEntrance)==2){ ?><input name="entrance[]" value="2" type="checkbox" checked /><?php } ?>
                                手机单</li>
                            <li class="fl">
                                <?php if(count($taskEntrance)<=0){ ?><input name="entrance[]" value="1" type="checkbox" />
                                <?php }elseif(count($taskEntrance)==1){ ?>
                                    <?php if($taskEntrance[0]==1){ ?><input name="entrance[]" value="1" type="checkbox" checked />
                                    <?php }else{ ?><input name="entrance[]" value="1" type="checkbox" /><?php } ?>
                                <?php }elseif(count($taskEntrance)==2){ ?><input name="entrance[]" value="1" type="checkbox" checked /><?php } ?>
                                电脑单</li>
                            <li class="fl">
                                <?php if(count($payType)<=0){ ?><input name="pay_type[]" value="2" type="checkbox" />
                                <?php }elseif(count($payType)==1){ ?>
                                    <?php if($payType[0]==2){ ?><input name="pay_type[]" value="2" type="checkbox" checked />
                                    <?php }else{ ?><input name="pay_type[]" value="2" type="checkbox" /><?php } ?>
                                <?php }elseif(count($payType)==2){ ?><input name="pay_type[]" value="2" type="checkbox" checked /><?php } ?>
                                远程单</li>
                            <li class="fl">
                                <?php if(count($payType)<=0){ ?><input name="pay_type[]" value="1" type="checkbox" />
                                <?php }elseif(count($payType)==1){ ?>
                                    <?php if($payType[0]==1){ ?><input name="pay_type[]" value="1" type="checkbox" checked />
                                    <?php }else{ ?><input name="pay_type[]" value="1" type="checkbox" /><?php } ?>
                                <?php }elseif(count($payType)==2){ ?><input name="pay_type[]" value="1" type="checkbox" checked /><?php } ?>
                                垫付单</li>
                        </ul>
                    </dd>
                </dl>
                <dl class="task-filter cf">
                    <dt class="fl">任务星级</dt>
                    <dd class="fl">
                        <ul class="selection cf">
                            <?php foreach($levelArr as $k=>$v){ ?>
                                <li class="fl">
                                <?php if($v==0){ ?>
                                <input name="bg_id[]" value="<?php echo $k+1; ?>" type="checkbox" />
                                <?php }else{ ?>
                                <input name="bg_id[]" value="<?php echo $k+1; ?>" type="checkbox" checked />
                                <?php } ?>
                                <?php if($k==0){ ?><img src="/static/images/level<?php echo $k+1; ?>.png" />
                                <?php }else{ ?><img src="/static/images/level<?php echo $k+1; ?>.gif" /><?php } ?>
                                </li>
                            <?php } ?>
                        </ul>
                    </dd>
                </dl>
                <dl class="task-filter cf">
                    <dt class="fl">任务价格</dt>
                    <dd class="fl">
                        <ul class="selection cf">
                            <li class="fl">
                                <input name="total_price" value="all" type="radio" <?php if(empty($taskPrice)){ ?>checked<?php } ?> />
                                所有</li>
                            <li class="fl">
                                <input name="total_price" value="0;50" type="radio" <?php if($taskPrice=='0;50'){ ?>checked<?php } ?> />
                                0-50元</li>
                            <li class="fl">
                                <input name="total_price" value="50;150" type="radio" <?php if($taskPrice=='50;150'){ ?>checked<?php } ?> />
                                50-150元</li>
                            <li class="fl">
                                <input name="total_price" value="150;300" type="radio" <?php if($taskPrice=='150;300'){ ?>checked<?php } ?> />
                                150-300</li>
                            <li class="fl">
                                <input name="total_price" value="300;500" type="radio" <?php if($taskPrice=='300;500'){ ?>checked<?php } ?> />
                                300-500</li>
                            <li class="fl">
                                <input name="total_price" value="500;999999" type="radio" <?php if($taskPrice=='500;999999'){ ?>checked<?php } ?> />
                                500以上</li>
                        </ul>
                    </dd>
                </dl>
            </form>
            <dl class="task-filter cf ff">
                <dt class="fl"> 任务搜索 </dt>
                <dd class="cf class="fl"">
                <!-- 高级搜索 -->
                <div class="search-wrap fl">
                    <form class="search-form form-horizontal" id="searchForm" action="" method="post">
                        <select class="form-control input-3x" name="searchKey">
                            <option value="">请选择</option>
                            <option value="task_no">任务编号</option>
                            <option value="nickname">商家会员名</option>
                        </select>
                        <input name="searchWord" class="form-control input-4x" type="text" />
                        <input class="btn btn-search" value="搜索" type="submit" />
                    </form>
                </div>
                <div class="btn-panel ff"> <a target="_blank" class="btn btn-xlarge btn-orange rela" href="/task/tasktemplate">发布任务</a> <a class="btn btn-xlarge" href="/task/tbtask">刷新任务</a> </div>
                </dd>
            </dl>
        </div>
        <div class="data-table main-list">
            <table>
                <colgroup class="yel">
                    <col width="23%">
                    <col width="15%">
                    <col width="15%">
                    <col width="23%">
                    <col width="24%">
                </colgroup>
                <thead class="list-head">
                <tr>
                    <th>任务编号</th>
                    <th>任务金额</th>
                    <th>任务佣金</th>
                    <th>任务需求</th>
                    <th>任务操作</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach($page->items as $item){ ?>
                <tr class="task-list">
                    <td colspan="6">
                        <div class="data-table task-info">
                            <table>
                                <colgroup>
                                    <col width="23%">
                                    <col width="15%">
                                    <col width="15%">
                                    <col width="23%">
                                    <col width="24%">
                                </colgroup>
                                <tbody>
                                <tr class="head">
                                    <td colspan="5">任务类型：淘宝&nbsp;&nbsp;&nbsp;&nbsp;任务摘要：<?php echo $item->t->task_summary; ?></td>
                                </tr>
                                <tr class="body">
                                    <td>
                                        <p>任务编号：<?php echo $item->t->task_serial; ?></p>
                                        <p>发布者：<?php echo $item->u->user_name; ?>(经验:<?php echo $item->u->user_exp; ?>)</p>
                                    </td>
                                    <td><b class="orange f22"><?php echo $item->t->task_total_price; ?></b></td>
                                    <td><b class="orange f22"><?php echo $item->t->task_commission; ?></b></td>
                                    <td>
                                        <p>
                                            <?php if($item->t->task_buyer_level==1){ ?><img src="/static/images/level1.png" />
                                            <?php }else{ ?><img src="/static/images/level<?php echo $item->t->task_buyer_level; ?>.gif" /><?php } ?>
                                        </p>
                                        <p>
                                            <span class="btn btn-tag"><?php if($item->t->task_pay_type==1){ ?>垫付<?php }elseif($item->t->task_pay_type==2){ ?>远程<?php } ?></span>
                                            <span class="btn btn-tag"><?php if($item->t->task_entrance==1){ ?>电脑拍<?php }elseif($item->t->task_entrance==2){ ?>手机拍<?php } ?></span>
                                            <span class="btn btn-tag"><?php echo $item->t->task_return_time; ?>小时返</span>
                                            <span class="btn btn-tag">
                                                <?php if($item->t->task_return_type==1){ ?>余额
                                                <?php }elseif($item->t->task_return_type==2||$item->t->task_return_type==4){ ?>支付宝
                                                <?php }elseif($item->t->task_return_type==3){ ?>财付通
                                                <?php }elseif($item->t->task_return_type==5){ ?>其他<?php } ?>
                                            </span>
                                        </p>
                                    </td>
                                    <td class="operate"> <a href="javascript:void(0);" class="btn btn-orange add-order qune">立即抢单</a> </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </td>
                </tr>
                <?php } ?>
                </tbody>
            </table>
        </div>
        <div class="cf">
            <div class="page ff">
                <?php for($i=$startNum;$i<=$lastNum;$i++){ ?>
                    <?php if($currentPage==$i){ ?>
                    <span class="current"><?php echo $currentPage; ?></span>
                    <?php }else{ ?>
                    <a class="num" href="/task/tbtask?page=<?php echo $i; ?>"><?php echo $i; ?></a>
                    <?php } ?>
                <?php } ?>
                <a class="next" href="/task/tbtask?page=<?php echo $page->next; ?>">下一页  &gt;&gt;</a>
                <a class="end" href="/task/tbtask?page=<?php echo $page->last; ?>">尾页</a>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/static/js/tbtask.js"></script>